def js1(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '广州市':location.href = "./广州市_labs.html";break;
                                    case '深圳市':location.href = "./深圳市_labs.html";break;
                                    case '珠海市':location.href = "./珠海市_labs.html";break;
                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1

with open('D:/Courses/SmallThree/scrapy_spider/广东地图.html', 'a', encoding="utf-8") as f:
    f.write(js1(char_id='98c9ad65f20a4e1dbf53793a39b0f1cf'))


def js2(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '昌平区':location.href = "./昌平区_labs.html";break;
                                    case '海淀区':location.href = "./海淀区_labs.html";break;
                                    case '朝阳区':location.href = "./朝阳区_labs.html";break;
                                    case '石景山区':location.href = "./石景山区_labs.html";break;
                                    case '西城区':location.href = "./西城区_labs.html";break;
                                    case '东城区':location.href = "./东城区_labs.html";break;
                                    case '丰台区':location.href = "./丰台区_labs.html";break;
                                    case '房山区':location.href = "./房山区_labs.html";break;
                                    case '大兴区':location.href = "./大兴区_labs.html";break;
                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1

with open('D:/Courses/SmallThree/scrapy_spider/北京地图.html', 'a', encoding="utf-8") as f:
    f.write(js2(char_id='7d3d2ab177ab458db7696032bb70f917'))


def js3(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '闵行区':location.href = "./闵行区_labs.html";break;
                                    case '浦东新区':location.href = "./浦东新区_labs.html";break;
                                    case '徐汇区':location.href = "./徐汇区_labs.html";break;
                                    case '黄浦区':location.href = "./黄浦区_labs.html";break;
                                    case '静安区':location.href = "./静安区_labs.html";break;
                                    case '杨浦区':location.href = "./杨浦区_labs.html";break;
                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1

with open('D:/Courses/SmallThree/scrapy_spider/上海地图.html', 'a', encoding="utf-8") as f:
    f.write(js3(char_id='2685053d03884633aa36323c90c2955b'))


def js4(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '东丽区':location.href = "./东丽区_labs.html";break;
                                    case '西青区':location.href = "./西青区_labs.html";break;
                                    case '红桥区':location.href = "./红桥区_labs.html";break;
                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1

with open('D:/Courses/SmallThree/scrapy_spider/天津地图.html', 'a', encoding="utf-8") as f:
    f.write(js4(char_id='97c6a34f492f45a8b6cefe6962e9be16'))

def js5(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '成都市':location.href = "./成都市_labs.html";break;
                                    case '绵阳市':location.href = "./绵阳市_labs.html";break;
                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1

with open('D:/Courses/SmallThree/scrapy_spider/四川地图.html', 'a', encoding="utf-8") as f:
    f.write(js5(char_id='3bb4aa131804412fb9e042431817f4c4'))


def js6(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '淮南市':location.href = "./淮南市_labs.html";break;
                                    case '合肥市':location.href = "./合肥市_labs.html";break;
                                    case '芜湖市':location.href = "./芜湖市_labs.html";break;
                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1

with open('D:/Courses/SmallThree/scrapy_spider/安徽地图.html', 'a', encoding="utf-8") as f:
    f.write(js6(char_id='78377e7e490f40a7805bf7d305594a90'))


def js7(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '济南市':location.href = "./济南市_labs.html";break;
                                    case '泰安市':location.href = "./泰安市_labs.html";break;
                                    case '青岛市':location.href = "./青岛市_labs.html";break;
                                    case '临沂市':location.href = "./临沂市_labs.html";break;
                                    case '威海市':location.href = "./威海市_labs.html";break;
                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1

with open('D:/Courses/SmallThree/scrapy_spider/山东地图.html', 'a', encoding="utf-8") as f:
    f.write(js7(char_id='a16ae3b1c542451f98237d71037e1bf8'))


def js8(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '南京市':location.href = "./南京市_labs.html";break;
                                    case '无锡市':location.href = "./无锡市_labs.html";break;
                                    case '苏州市':location.href = "./苏州市_labs.html";break;
                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1

with open('D:/Courses/SmallThree/scrapy_spider/江苏地图.html', 'a', encoding="utf-8") as f:
    f.write(js8(char_id='184045fbc90d4c6c8aa5347c27d14b81'))


def js9(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '南昌市':location.href = "./南昌市_labs.html";break;
                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1

with open('D:/Courses/SmallThree/scrapy_spider/江西地图.html', 'a', encoding="utf-8") as f:
    f.write(js9(char_id='57fb125edf324068afca890e82e0fc54'))


def js10(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '保定市':location.href = "./保定市_labs.html";break;
                                    case '廊坊市':location.href = "./廊坊市_labs.html";break;
                                    case '石家庄市':location.href = "./石家庄市_labs.html";break;
                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1

with open('D:/Courses/SmallThree/scrapy_spider/河北地图.html', 'a', encoding="utf-8") as f:
    f.write(js10(char_id='08c86932c94b4d89b6d28d6a8e81a5b9'))


def js11(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '杭州市':location.href = "./杭州市_labs.html";break;
                                    case '宁波市':location.href = "./宁波市_labs.html";break;
                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1

with open('D:/Courses/SmallThree/scrapy_spider/浙江地图.html', 'a', encoding="utf-8") as f:
    f.write(js11(char_id='51ef8af52d8d4133a24f4cbe662d2798'))


def js20(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '武汉市':location.href = "./武汉市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/湖北地图.html', 'a', encoding="utf-8") as f:
    f.write(js20(char_id='445acc3a147746cbbcea0651bebc1908'))


def js21(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '长沙市':location.href = "./长沙市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/湖南地图.html', 'a', encoding="utf-8") as f:
    f.write(js21(char_id='5d7308d62ac44cdba6ba02a759b00966'))


def js22(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '福州市':location.href = "./福州市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/福建地图.html', 'a', encoding="utf-8") as f:
    f.write(js22(char_id='0fccb7061c1748829018e7dfb1743166'))


def js23(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '武威市':location.href = "./武威市_labs.html";break;
                                    case '兰州市':location.href = "./兰州市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/甘肃地图.html', 'a', encoding="utf-8") as f:
    f.write(js23(char_id='8f7a64cec1754652820f89ff3d8f612b'))


def js24(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '柳州市':location.href = "./柳州市_labs.html";break;
                                    case '南宁市':location.href = "./南宁市_labs.html";break;
                                    case '玉林市':location.href = "./玉林市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/广西地图.html', 'a', encoding="utf-8") as f:
    f.write(js24(char_id='c63f16d774da4f0f9e4c4325529d7eb9'))


def js25(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '贵阳市':location.href = "./贵阳市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/贵州地图.html', 'a', encoding="utf-8") as f:
    f.write(js25(char_id='22473381e2794e8796027f98e867e0f5'))


def js26(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '洛阳市':location.href = "./洛阳市_labs.html";break;
                                    case '郑州市':location.href = "./郑州市_labs.html";break;
                                    case '新乡市':location.href = "./新乡市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/河南地图.html', 'a', encoding="utf-8") as f:
    f.write(js26(char_id='11489ff9210742d59d50c7fc02ab17c4'))


def js27(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '哈尔滨市':location.href = "./哈尔滨市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/黑龙江地图.html', 'a', encoding="utf-8") as f:
    f.write(js27(char_id='351d92d2f28846e2827315b2cf95933c'))


def js28(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '呼和浩特市':location.href = "./呼和浩特市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/内蒙古地图.html', 'a', encoding="utf-8") as f:
    f.write(js28(char_id='0d2e5316885d44ce842a057ecc4e75e1'))


def js29(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '长春市':location.href = "./长春市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/吉林地图.html', 'a', encoding="utf-8") as f:
    f.write(js29(char_id='9be6bcdb9e5b45afb5838bc4782fe109'))


def js30(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '沈阳市':location.href = "./沈阳市_labs.html";break;
                                    case '大连市':location.href = "./大连市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/辽宁地图.html', 'a', encoding="utf-8") as f:
    f.write(js30(char_id='30f8af9f732b488596bfbb8e109b5bb3'))


def js33(char_id):
    jsCode1 = '''
                <script>
                        chart_''' + char_id + '''.on('click', function (param){
                            var selected = param.name;
                                if (selected) {
                                    switch(selected){
                                        case '太原市':location.href = "./太原市_labs.html";break;

                                        default:
                                            break;
                                    }
                                }
                            });
                    </script>    
                    '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/山西地图.html', 'a', encoding="utf-8") as f:
    f.write(js33(char_id='59143bda248448da90b6b1dd15038c3b'))


def js38(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '昆明市':location.href = "./昆明市_labs.html";break;
                                    case '玉溪市':location.href = "./玉溪市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/云南地图.html', 'a', encoding="utf-8") as f:
    f.write(js38(char_id='0696cd4248094c229756b3520ceaa169'))


def js37(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '乌鲁木齐市':location.href = "./乌鲁木齐市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/新疆地图.html', 'a', encoding="utf-8") as f:
    f.write(js37(char_id='8cf8b6ca6430407e8c3b7f842f725932'))


def js34(char_id):
    jsCode1 = '''
                <script>
                    chart_''' + char_id + '''.on('click', function (param){
                        var selected = param.name;
                            if (selected) {
                                switch(selected){
                                    case '西安市':location.href = "./西安市_labs.html";break;
                                    case '咸阳市':location.href = "./咸阳市_labs.html";break;

                                    default:
                                        break;
                                }
                            }
                        });
                </script>    
                '''
    return jsCode1


with open('D:/Courses/SmallThree/scrapy_spider/陕西地图.html', 'a', encoding="utf-8") as f:
    f.write(js34(char_id='e478107dfd904a03bbe8eec98624eb1f'))







